<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="com.alibaba.fastjson.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script src="echart/jquery-1.9.1.min.js"></script>
<title>Insert title here</title>
<style>
/* Border styles */

table thead, table tr {
border-top-width: 1px;
border-top-style: solid;
border-top-color: #1da4f2;
}
table {
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #1da4f2;
}
 
/* Padding and font style */
table td, table th {
padding: 5px 10px;
font-size: 12px;
font-family: Verdana;
color: black;
}
 
/* Alternating background colors */
table tr:nth-child(even) {
background: #1da4f2
}
table tr:nth-child(odd) {
background: #B0E2FF
}
</style>
</head>
<body>
<input type="button" value="返回" onclick="history.back();">
<br>
<form method="post" action="SubjectSubmit">
<input type="hidden" name="pdbbm" value="${assess.pdbbm}">
<input type="hidden" name="pdbmc" value="${assess.pdbmc}">
<table border="1" cellspacing="0" width="100%">
<tr>
<th colspan="8" bgcolor="gray">${assess.pdbmc}</th>
</tr>

<c:forEach items="${assess.subjects}" var="subject" varStatus="i">
<tr>
	<td colspan="8" bgcolor="gray">
		${i.count}、${subject.ysmc}
	</td>
</tr>
<c:forEach items="${subject.chooses}" var="choose">
	<tr>
		<td colspan="7">${choose.yszmc}(${choose.yszf})</td>
		<td align="center">
		<c:choose>
			<c:when test="${choose.ischeck==1}">
				<input name="${subject.ysbm}_${subject.ysmc}" type="radio" value="${choose.yszbm}_${choose.yszmc}_${choose.yszf}" checked/>
			</c:when>
			<c:otherwise>
				<input name="${subject.ysbm}_${subject.ysmc}" type="radio" value="${choose.yszbm}_${choose.yszmc}_${choose.yszf}"/>
			</c:otherwise>
		</c:choose>
		</td>
	</tr>
</c:forEach>

</c:forEach>
</table>
总分(<span id="total"></span>)
<center><input type="submit" value="提交" style="width:20%"></center>
</form>
<script type="text/javascript">
$('input:radio').click(function(){
	var total = 0;
	$('input[type="radio"]:checked').each(function(){
		var value = $(this).val();
		total = total +parseFloat(value.split("_")[2]);
	});
	$("#total").html(total);
});


var total = 0;
$('input[type="radio"]:checked').each(function(){
	var value = $(this).val();
	total = total +parseFloat(value.split("_")[2]);
});
$("#total").html(total);
</script>
</body>
</html>